using Microsoft.AspNetCore.Connections;
using WebApplication1;

var builder = WebApplication.CreateSlimBuilder(args);

builder.WebHost.ConfigureKestrel(op => 
    op.ListenAnyIP(4040, c => c.UseConnectionHandler<RpcConnectionHandler>()));

var app = builder.Build();

app.Run();